<template>
  <div class="app-container">
    <el-row :gutter="20">
        <el-col :span="6">
            <el-card class="box-card">
              <el-card-header>
                <span>题录数据统计------截止到{{currentDate}}</span>
              </el-card-header>
              <div style="margin-top:20px;">
                 <el-table
                    :data="tableData"
                    style="width: 100%">
                    <el-table-column
                      prop="name"
                      label="名称"
                      width="180">
                    </el-table-column>
                    <el-table-column
                      prop="number"
                      label="数量">
                    </el-table-column>
                  </el-table>
              </div>
            </el-card>
        </el-col>
        <el-col :span="6">
            <el-card class="box-card">
              <el-card-header>
                <span>文本数据统计------截止到{{currentDate}}</span>
              </el-card-header>
              <div style="margin-top:20px;">
                 <el-table
                    :data="textTableData"
                    style="width: 100%">
                    <el-table-column
                      prop="name"
                      label="名称"
                      width="180">
                    </el-table-column>
                    <el-table-column
                      prop="number"
                      label="数量">
                    </el-table-column>
                  </el-table>
              </div>
            </el-card>
        </el-col>
         <el-col :span="6">
            <el-card class="box-card">
              <el-card-header>
                <span>其他统计------截止到{{currentDate}}</span>
              </el-card-header>
              <div style="margin-top:20px;">
                 <el-table
                    :data="otherTableData"
                    style="width: 100%">
                    <el-table-column
                      prop="name"
                      label="名称"
                      width="180">
                    </el-table-column>
                    <el-table-column
                      prop="number"
                      label="数量">
                    </el-table-column>
                  </el-table>
              </div>
            </el-card>
        </el-col>
    </el-row>


    
    <!--<el-row :gutter="20">
       <el-col :span="4">
        <div>
          <el-statistic
            group-separator=","
            :precision="2"
            :value="this.totalTitle"
            :title="this.totaltitleT"
          ></el-statistic>
        </div>
      </el-col>
      <el-col :span="4">
        <div>
          <el-statistic
            group-separator=","
            :precision="2"
            :value="this.gbTitle"
            title='国标题录'
          ></el-statistic>
        </div>
      </el-col>
      <el-col :span="4">
        <div>
          <el-statistic
            group-separator=","
            :precision="2"
            :value="this.dbTitle"
            title='地标题录'
          ></el-statistic>
        </div>
      </el-col>
      <el-col :span="4">
        <div>
          <el-statistic
            group-separator=","
            :precision="2"
            :value="this.MZTitle"
            title='蒙字标'
          ></el-statistic>
        </div>
      </el-col> -->
      <!-- <el-col :span="4">
        <div>
          <el-statistic
            group-separator=","
            :precision="2"
            :value="this.totalUser"
            title='用户数量'
          ></el-statistic>
        </div>
      </el-col> -->
      <!-- <el-col :span="6">
        <div>
          <el-statistic
            group-separator=","
            :precision="2"
            :value="this.NMTitle"
            title='内蒙古地方标准题录'
          ></el-statistic>
        </div>
      </el-col> 
    </el-row>-->
    <!--<el-row style="margin-top: 20px;">
       <el-col :span="4">
        <div>
          <el-statistic
            group-separator=","
            :precision="2"
            :value="this.hbTitle"
            title='行标题录'
          ></el-statistic>
        </div>
      </el-col>
      <el-col :span="4">
        <div>
          <el-statistic
            group-separator=","
            :precision="2"
            :value="this.tbTitle"
            title='团标题录'
          ></el-statistic>
        </div>
      </el-col>
      <el-col :span="4">
        <div>
          <el-statistic
            group-separator=","
            :precision="2"
            :value="this.gwTitle"
            title='国外标准题录'
          ></el-statistic>
        </div>
      </el-col> -->
      <!-- <el-col :span="4">
        <div>
          <el-statistic
            group-separator=","
            :precision="2"
            :value="this.gbText"
            title='国标文本数量'
          ></el-statistic>
        </div>
      </el-col>
      <el-col :span="4">
        <div>
          <el-statistic
            group-separator=","
            :precision="2"
            :value="this.hbText"
            title='行标文本数量'
          ></el-statistic>
        </div>
      </el-col> 
    </el-row>-->
    <!-- <el-row style="margin-top: 20px;">
      <el-col :span="4">
        <div>
          <el-statistic
            group-separator=","
            :precision="2"
            :value="this.dbText"
            title='地标文本数量'
          ></el-statistic>
        </div>
      </el-col>
      <el-col :span="4">
        <div>
          <el-statistic
            group-separator=","
            :precision="2"
            :value="this.tbText"
            title='团标文本数量'
          ></el-statistic>
        </div>
      </el-col>
    </el-row> -->
    <!-- <el-row :gutter="20" style="margin-top:50px;"> -->

      <!-- <el-col :span="6">
        <div>
          <el-statistic
            group-separator=","
            :precision="2"
            :value="this.fileTitle"
            title='总文本'
          ></el-statistic>
        </div>
      </el-col> -->

      <!-- <el-col :span="6">
        <div>
          <el-statistic
            group-separator=","
            :precision="2"
            :value="this.totalMoney"
            title='销售额'
          ></el-statistic>
        </div>
      </el-col> -->
    <!-- </el-row> -->
    <el-row style="margin-top:20px;margin-bottom:20px;">
      <el-col :span="12">
        <el-date-picker
          v-model="selectedDateRange"
          type="daterange"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          format="yyyy-MM-dd"
          value-format="yyyy-MM-dd"
          :picker-options="{
            firstDayOfWeek: 1,
            disabledDate(time) {
              return time.getTime() > Date.now();
            }
          }"
        />
        <el-button style="margin-left:20px;" type="primary" @click="startStatic">开始统计</el-button>
      </el-col>
    </el-row>
    <el-row :gutter="20">
        <el-col :span="6">
            <el-card class="box-card">
              <el-card-header>
                <span>题录数据统计---{{startDate}}至{{endDate}}</span>
              </el-card-header>
              <div style="margin-top:20px;">
                 <el-table
                    :data="timeTableData"
                    style="width: 100%">
                    <el-table-column
                      prop="name"
                      label="名称"
                      width="180">
                    </el-table-column>
                    <el-table-column
                      prop="number"
                      label="数量">
                    </el-table-column>
                  </el-table>
              </div>
            </el-card>
        </el-col>
        <el-col :span="6">
            <el-card class="box-card">
              <el-card-header>
                <span>文本数据统计---{{startDate}}至{{endDate}}</span>
              </el-card-header>
              <div style="margin-top:20px;">
                 <el-table
                    :data="timeTextTableData"
                    style="width: 100%">
                    <el-table-column
                      prop="name"
                      label="名称"
                      width="180">
                    </el-table-column>
                    <el-table-column
                      prop="number"
                      label="数量">
                    </el-table-column>
                  </el-table>
              </div>
            </el-card>
        </el-col>
         <el-col :span="6">
            <el-card class="box-card">
              <el-card-header>
                <span>其他统计---{{startDate}}至{{endDate}}</span>
              </el-card-header>
              <div style="margin-top:20px;">
                 <el-table
                    :data="timeOtherTableData"
                    style="width: 100%">
                    <el-table-column
                      prop="name"
                      label="名称"
                      width="180">
                    </el-table-column>
                    <el-table-column
                      prop="number"
                      label="数量">
                    </el-table-column>
                  </el-table>
              </div>
            </el-card>
        </el-col>
    </el-row>
    <el-row>
      <!-- <el-col :span="4">
        <div style="text-align: center;">
          <el-statistic
            group-separator=","
            :precision="2"
            title='题录新增'
          ></el-statistic>
          {{this.titleAddTotalNum}}

        </div>
      </el-col>
      <el-col :span="4">
        <div style="text-align: center;">
          <el-statistic
            group-separator=","
            :precision="2"
            title='题录更新'
          ></el-statistic>
          {{this.titleUpdateNum}}
        </div>
      </el-col> 
      <el-col :span="4">
        <div style="text-align: center;">
          <el-statistic
            group-separator=","
            :precision="2"
            title='文本新增'
          ></el-statistic>
          {{this.textAdd}}
        </div>
      </el-col>-->
      <!-- <el-col :span="4">
        <div style="text-align: center;">
          <el-statistic
            group-separator=","
            :precision="2"
            title='下载量'
          ></el-statistic>
          {{this.downLoad}}
        </div>
      </el-col>
      <el-col :span="4">
        <div style="text-align: center;">
          <el-statistic
            group-separator=","
            :precision="2"
            title='访问量'
          ></el-statistic>
          {{this.viewTotalNum}}
        </div>
      </el-col> -->
    </el-row>
    <el-row style="margin-top: 20px;">
      <el-col :span="12">
        <div ref="first" style="width: 100%; height: 400px;"></div>
      </el-col>
      <el-col :span="12">
        <div ref="second" style="width: 100%; height: 400px;"></div>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="12">
        <div ref="third" style="width: 100%; height: 400px;"></div>
      </el-col>
      <el-col :span="12">
        <div ref="four" style="width: 100%; height: 400px;"></div>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="12">
        <div ref="five" style="width: 100%; height: 400px;"></div>
      </el-col>
      <el-col :span="12">
        <div ref="six" style="width: 100%; height: 400px;"></div>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="12">
        <div ref="seven" style="width: 100%; height: 400px;"></div>
      </el-col>
      <el-col :span="12">
        <div ref="eight" style="width: 100%; height: 400px;"></div>
      </el-col>
    </el-row>
        <!-- <el-row>
      <el-col :span="12">
        <div ref="nine" style="width: 100%; height: 400px;"></div>
      </el-col>
      <el-col :span="12">
        <div ref="ten" style="width: 100%; height: 400px;"></div>
      </el-col>
    </el-row> -->
    <!-- <el-row>
      <el-col :span="12">
        <div ref="eleven" style="width: 100%; height: 400px;"></div>
      </el-col>
      <el-col :span="12">
        <div ref="towelve" style="width: 100%; height: 400px;"></div>
      </el-col>
    </el-row>
        <el-row>
      <el-col :span="12">
        <div ref="thirteen" style="width: 100%; height: 400px;"></div>
      </el-col>
      <el-col :span="12">
        <div ref="fourth" style="width: 100%; height: 400px;"></div>
      </el-col>
    </el-row> -->
    <el-row>
      <el-col :span="12">
        <div ref="fiveth" style="width: 100%; height: 400px;"></div>
      </el-col>
      <el-col :span="12">
        <div ref="sixfh" style="width: 100%; height: 400px;"></div>
      </el-col>
    </el-row>
        <el-row>
      <el-col :span="12">
        <div ref="seventh" style="width: 100%; height: 400px;"></div>
      </el-col>
      <el-col :span="12">
        <div ref="eightth" style="width: 100%; height: 400px;"></div>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="12">
        <div ref="nineth" style="width: 100%; height: 400px;"></div>
      </el-col>
      <el-col :span="12">
        <div ref="twoteenth" style="width: 100%; height: 400px;"></div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import {
  getTotalTitle,
  getGbTitle,
  getDbTitle,
  getNmTitle,
  getMtitle,
  getTotalFile,
  getTotalUser,
  getHbTitle,
  getTbTitle,
  getGwtitle,
  getGbText,
  getHbText,
  getDbText,
  getTbText,
  getTotalMoney,
  chargeDeposit,
  cellNumber,
  titleUpdate,
  fileUpdate,
  gbUpdate,
  gbUpdateTotal,
  hbUpdate,
  hbUpdateTotal,
  viewTotal,
  downTotal,
  getTitleAdd,
  getTextAdd,
  getDownLoad,
  getViewTotalNum,
  getTitleUpdate,
  dbUpdate,
  dbUpdateTotal,
  tbUpdate,
  tbUpdateTotal,
  gbAdd,
  hbAdd,
  tbAdd,
  dbAdd,
  getGwText
} from "@/api/system/statistics.js";
import * as echarts from 'echarts';

export default {
  name: "Db15",
  data() {
    return {
      totaltitleT: '总题录',
      totalTitle: '',
      gbTitle: '',
      dbTitle: '',
      NMTitle: '',
      MZTitle: '',
      fileTitle: '',
      totalUser: '',
      hbTitle: '',
      tbTitle: '',
      gwTitle: '',
      gbText: '',
      hbText: '',
      dbText: '',
      tbText: '',
      titleAddTotalNum: '',
      titleUpdateNum: '',
      textAdd: '',
      downLoad: '',
      viewTotal: '',
      viewTotalNum: '',
      totalMoney: '',
      selectedDateRange: [],
      tableData: [],
      textTableData: [],
      otherTableData: [],
      currentDate: new Date().toLocaleDateString(),
      timeTextTableData: [],
      timeOtherTableData: [],
      timeTableData:[],
      startDate: '',
      endDate: ''
    };
  },
  created() {
    this.getTTotalTitle();
    // this.gettGbTitle();
    // this.getTDbTitle();
    this.getTNumTitle();
    this.getTmTitle();
    this.getTTotalFile();
    this.getTtTotalUser();
    this.getTTotalMoney();
    // this.getGbTextTotle();
    // this.getHbTextTotle();
    // this.getDbTextTotle();
    // this.getTbTextTotle();
    // this.getGwTitleTotle();
    // this.getHbTitleTotle();
    // this.getTbTitleTotle();
    // this.getGwTextTotle();

    this.getTitleAddNumTotal();
    this.getTextAddNumTotal();
    this.getDownLoadNumTotal();
    this.getViewTotalNumTotal();
    this.getTitleUpdateNumTotal();
  },
  mounted() {
    // this.initFirstChart();
    // this.initSecordChart();
    // this.initThirdChart();
    // this.initFourChart();
    this.startStatic()
  },
  watch: {},
  methods: {
    // 总题录

    getTTotalTitle() {
      // 国标题录
      getGbTitle().then((response) => {
          this.gbTitle = response.data.data;
          this.tableData.push({
            name: '国标题录',
            number: this.gbTitle
          })
          // 地标题录
          getDbTitle().then((response) => {
            this.dbTitle = response.data.data;
            this.tableData.push({
              name: '地标题录',
              number: this.dbTitle
            })
            getHbTitle().then((response) => {
              this.hbTitle = response.data.data;
              this.tableData.push({
                name: '行标题录',
                number: this.hbTitle
              })
              getTbTitle().then((response) => {
                this.tbTitle = response.data.data;
                this.tableData.push({
                  name: '团标题录',
                  number: this.tbTitle
                })

                // this.tableData.push({
                //   name: '国际国外标准题录',
                //   number: (parseInt(this.totalTitle, 10)  - parseInt(this.gbTitle, 10) - parseInt(this.dbTitle, 10) - parseInt(this.hbTitle, 10) - parseInt(this.tbTitle, 10))
                // })
                getGwtitle().then((response) => {
                  this.gwTitle = response.data.data;
                  this.tableData.push({
                    name: '国外标准题录',
                    number: this.gwTitle
                  })
                  this.tableData.push({
                    name: this.totaltitleT,
                    number: (parseInt(this.gbTitle, 10) + parseInt(this.dbTitle, 10) + parseInt(this.hbTitle, 10) + parseInt(this.tbTitle, 10)+parseInt(this.gwTitle, 10))
                  })
                });
              });
            });
        });


      // getTotalTitle().then((response) => {
      //   this.totalTitle = response.data.data;
      //   this.tableData.push({
      //     name: this.totaltitleT,
      //     number: this.totalTitle
      //   })
        
      // });
      })
    },
    // gettGbTitle() {
      // getGbTitle().then((response) => {
      //     this.gbTitle = response.data.data;
      //     this.tableData.push({
      //       name: '国标题录',
      //       number: this.gbTitle
      //     })
      //   });
    // },
    // getTDbTitle() {
    //   // 地标题录
    //   getDbTitle().then((response) => {
    //     this.dbTitle = response.data.data;
    //     this.tableData.push({
    //       name: '地标题录',
    //       number: this.dbTitle
    //     })
    //   });
    // },
    // getHbTitleTotle() {
    //   // 行标题录数量
    //   getHbTitle().then((response) => {
    //     this.hbTitle = response.data.data;
    //     this.tableData.push({
    //       name: '行标题录',
    //       number: this.hbTitle
    //     })
    //   });
    // },
    // getTbTitleTotle() {
    //   // 团标
    //   getTbTitle().then((response) => {
    //     this.tbTitle = response.data.data;
    //     this.tableData.push({
    //       name: '团标题录',
    //       number: this.tbTitle
    //     })
    //   });
    // },
    // getGwTitleTotle() {
    //   // 国外
    //   getGwtitle().then((response) => {
    //     this.gwTitle = response.data.data;
    //     this.tableData.push({
    //       name: '国外标准题录',
    //       number: this.gwTitle
    //     })
    //   });
    // },
    getTNumTitle(){
      // 内蒙古地方标准题录
      getNmTitle().then((response) => {
        this.NMTitle = response.data.data;
      });
    },
    //---------------------------------------------------------
    getTmTitle() {
      // 蒙字标
      getMtitle().then((response) => {
        this.MZTitle = response.data.data;
      });
    },
    //---------------------------------------------------------------
    getTTotalFile() {
      getGbText().then((response) => {
          this.gbText = response.data.data;
          this.textTableData.push({
            name: '国标文本',
            number: this.gbText
          })
          getHbText().then((response) => {
            this.hbText = response.data.data;
            this.textTableData.push({
              name: '行标文本',
              number: this.hbText
            })
            getDbText().then((response) => {
              this.dbText = response.data.data;
              this.textTableData.push({
                name: '地标文本',
                number: this.dbText
              })
              getTbText().then((response) => {
                this.tbText = response.data.data;
                this.textTableData.push({
                  name: '团标文本',
                  number: this.tbText
                })
                // this.textTableData.push({
                //     name: '国际国外文本',
                //     number: (parseInt(this.fileTitle, 10)  - parseInt(this.hbText, 10) - parseInt(this.gbText, 10) - parseInt(this.dbText, 10) - parseInt(this.tbText, 10))
                //   })
                getGwText().then((response) => {
                  let gwtext = response.data.data;
                  this.textTableData.push({
                    name: '国外文本',
                    number: gwtext
                  })
                  this.textTableData.push({
                    name: '总文本',
                    number: (parseInt(this.hbText, 10) + parseInt(this.gbText, 10) + parseInt(this.dbText, 10) + parseInt(this.tbText, 10) + parseInt(gwtext, 10))
                  })
                });
              });
            });
          });
        });
      // 总文本
      // getTotalFile().then((response) => {
      //   // this.fileTitle = response.data;
      //   this.fileTitle = response.data.data;
      //   this.textTableData.push({
      //     name: '总文本',
      //     number: this.fileTitle
      //   })
        
      // });
    },
    // getGbTextTotle() {
    //   // 国标文本
    //   getGbText().then((response) => {
    //     this.gbText = response.data.data;
    //     this.textTableData.push({
    //       name: '国标文本',
    //       number: this.gbText
    //     })
    //   });
    // },
    // getHbTextTotle() {
    //   // 行标文本
    //   getHbText().then((response) => {
    //     this.hbText = response.data.data;
    //     this.textTableData.push({
    //       name: '行标文本',
    //       number: this.hbText
    //     })
    //   });
    // },
    // getDbTextTotle() {
    //   // 地标文本
    //   getDbText().then((response) => {
    //     this.dbText = response.data.data;
    //     this.textTableData.push({
    //       name: '地标文本',
    //       number: this.dbText
    //     })
    //   });
    // },
    // getGwTextTotle() {
    //   // 国外文本
    //   getGwText().then((response) => {
    //     let gwtext = response.data.data;
    //     this.textTableData.push({
    //       name: '国外文本',
    //       number: gwtext
    //     })
    //   });
    // },
    // getTbTextTotle() {
    //   // 团标文本
    //   getTbText().then((response) => {
    //     this.tbText = response.data.data;
    //     this.textTableData.push({
    //       name: '团标文本',
    //       number: this.tbText
    //     })
    //   });
    // },
    getTtTotalUser() {
      // 用户数量
      getTotalUser().then((response) => {
        this.totalUser = response.data;
        this.otherTableData.push({
          name: '用户数量',
          number: this.totalUser
        })
      });
    },
    getTitleAddNumTotal() {
      getTitleAdd('','').then((response) => {
        // console.log("--------------------1111111")
        // console.log(response)
        // console.log(response.data[0].total)
        this.titleAddTotalNum = response.data[0].total;
        // console.log(this.titleAdd)
        // this.titleAdd = '111'
      });
    },

    getTitleUpdateNumTotal() {
      getTitleUpdate('','').then((response) => {
        // console.log("--------------------")
        // console.log(response)
        // console.log(response.data)
        this.titleUpdateNum = response.data[0].total;
      });
    },
    getTextAddNumTotal() {
      getTextAdd('','').then((response) => {
        // console.log("--------------------")
        // console.log(response)
        // console.log(response.data)
        this.textAdd = response.data[0].total;
      });
    },
    getDownLoadNumTotal() {
      getDownLoad('','').then((response) => {
        // console.log("--------------------")
        // console.log(response)
        // console.log(response.data)
        this.downLoad = response.data[0].total;
      });
    },
    getViewTotalNumTotal() {
      getViewTotalNum('','').then((response) => {
        // console.log("--------------------")
        // console.log(response)
        // console.log(response.data)
        this.viewTotalNum = response.data[0].total;
      });
    },

    getTTotalMoney() {
      // 销售额
      getTotalMoney().then((response) => {
        // console.log("--------------------")
        // console.log(response)
        this.totalMoney = response.msg;
      });
    },
    startStatic() {

      console.log(this.selectedDateRange)
      let beginTime = ''
      let endTime = ''
      if (this.selectedDateRange.length > 0) {
        beginTime = this.selectedDateRange[0]
        endTime = this.selectedDateRange[1]
      }
      this.startDate = beginTime
      this.endDate = endTime
      this.timeTableData = []
      this.timeTextTableData = []
      this.timeOtherTableData = []

      // 题录新增
      getTitleAdd(beginTime, endTime).then((response) => {
        this.titleAddTotalNum = response.data[0].total;
        this.timeTableData.push({
          name: '题录新增',
          number: this.titleAddTotalNum
        })
        // 题录更新
        getTitleUpdate(beginTime, endTime).then((response) => {
          this.titleUpdateNum = response.data[0].total;
          this.timeTableData.push({
            name: '题录更新',
            number: this.titleUpdateNum
          })
          gbUpdateTotal(beginTime, endTime).then((response) => {
            let gbu = response.data[0].total;
            this.timeTableData.push({
              name: '国标题录更新',
              number: gbu
            })
            hbUpdateTotal(beginTime, endTime).then((response) => {
              let hbu = response.data[0].total;
              this.timeTableData.push({
                name: '行标题录更新',
                number: hbu
              })
              dbUpdateTotal(beginTime, endTime).then((response) => {
                let dbu = response.data[0].total;
                this.timeTableData.push({
                  name: '地标题录更新',
                  number: dbu
                })
                tbUpdateTotal(beginTime, endTime).then((response) => {
                  let tbu = response.data[0].total;
                  this.timeTableData.push({
                    name: '团标题录更新',
                    number: tbu
                  })
                  this.timeTableData.push({
                    name: '国际国外标准题录更新',
                    number: Math.max(0, (parseInt(this.titleAddTotalNum, 10) + parseInt(this.titleUpdateNum, 10) - parseInt(gbu, 10) - parseInt(hbu, 10) - parseInt(dbu, 10) - parseInt(tbu, 10)))
                  })
                });
              });
            });
          });
        });
      });

      // 文本更新
      getTextAdd(beginTime, endTime).then((response) => {
        // console.log("--------------------")
        // console.log(response)
        // console.log(response.data)
        this.textAdd = response.data[0].total;
        this.timeTextTableData.push({
          name: '文本更新',
          number: this.textAdd
        })
      });
    

      // 下载量
      getDownLoad(beginTime, endTime).then((response) => {
        // console.log("--------------------")
        // console.log(response)
        // console.log(response.data)
        this.downLoad = response.data[0].total;
        this.timeOtherTableData.push({
          name: '下载量',
          number: this.downLoad
        })

      });


      // 访问量
      getViewTotalNum(beginTime, endTime).then((response) => {
        // console.log("--------------------")
        // console.log(response)
        // console.log(response.data)
        this.viewTotalNum = response.data[0].total;
        this.timeOtherTableData.push({
          name: '访问量',
          number: this.viewTotalNum
        })
      });
    



      chargeDeposit(beginTime, endTime).then((response) => {
        let data = response.data
        let x = []
        let y = []
        for (let i = 0; i < data.length; i++) {
          x.push(data[i].year + '-' + data[i].month)
          y.push(data[i].total)
        }
        this.initFirstChart(x, y)
      });
      cellNumber(beginTime, endTime).then((response) => {
        let data = response.data
        let x = []
        let y = []
        for (let i = 0; i < data.length; i++) {
          x.push(data[i].year + '-' + data[i].month)
          y.push(data[i].total)
        }
        this.initSecordChart(x, y)
      });
      titleUpdate(beginTime, endTime).then((response) => {
        let data = response.data
        let x = []
        let y = []
        for (let i = 0; i < data.length; i++) {
          x.push(data[i].year + '-' + data[i].month)
          y.push(data[i].total)
        }
        this.initThirdChart(x, y)
      });
      fileUpdate(beginTime, endTime).then((response) => {
        let data = response.data
        let x = []
        let y = []
        for (let i = 0; i < data.length; i++) {
          x.push(data[i].year + '-' + data[i].month)
          y.push(data[i].total)
        }
        this.initFourChart(x, y)
      });
      gbUpdate(beginTime, endTime).then((response) => {
        let data = response.data
        let x = []
        let y = []
        for (let i = 0; i < data.length; i++) {
          x.push(data[i].year + '-' + data[i].month)
          y.push(data[i].total)
        }
        this.initFiveChart(x, y)
      });
      hbUpdate(beginTime, endTime).then((response) => {
        let data = response.data
        let x = []
        let y = []
        for (let i = 0; i < data.length; i++) {
          x.push(data[i].year + '-' + data[i].month)
          y.push(data[i].total)
        }
        this.initSixChart(x, y)
      });
      viewTotal(beginTime, endTime).then((response) => {
        let data = response.data
        let x = []
        let y = []
        for (let i = 0; i < data.length; i++) {
          x.push(data[i].year + '-' + data[i].month)
          y.push(data[i].total)
        }
        this.initSevenChart(x, y)
      });
      downTotal(beginTime, endTime).then((response) => {
        let data = response.data
        let x = []
        let y = []
        for (let i = 0; i < data.length; i++) {
          x.push(data[i].year + '-' + data[i].month)
          y.push(data[i].total)
        }
        this.initEightChart(x, y)
      });
      dbUpdate(beginTime, endTime).then((response) => {
        let data = response.data
        let x = []
        let y = []
        for (let i = 0; i < data.length; i++) {
          x.push(data[i].year + '-' + data[i].month)
          y.push(data[i].total)
        }
        this.initthirthenChart(x, y)
      });
      tbUpdate(beginTime, endTime).then((response) => {
        let data = response.data
        let x = []
        let y = []
        for (let i = 0; i < data.length; i++) {
          x.push(data[i].year + '-' + data[i].month)
          y.push(data[i].total)
        }
        this.initFourteenChart(x, y)
      });
      gbAdd(beginTime, endTime).then((response) => {
        let data = response.data
        let x = []
        let y = []
        for (let i = 0; i < data.length; i++) {
          x.push(data[i].year + '-' + data[i].month)
          y.push(data[i].total)
        }
        this.initNineChart(x, y)
      });
      dbAdd(beginTime, endTime).then((response) => {
        let data = response.data
        let x = []
        let y = []
        for (let i = 0; i < data.length; i++) {
          x.push(data[i].year + '-' + data[i].month)
          y.push(data[i].total)
        }
        this.initTenChart(x, y)
      });
      hbAdd(beginTime, endTime).then((response) => {
        let data = response.data
        let x = []
        let y = []
        for (let i = 0; i < data.length; i++) {
          x.push(data[i].year + '-' + data[i].month)
          y.push(data[i].total)
        }
        this.initElevenChart(x, y)
      });
      tbAdd(beginTime, endTime).then((response) => {
        let data = response.data
        let x = []
        let y = []
        for (let i = 0; i < data.length; i++) {
          x.push(data[i].year + '-' + data[i].month)
          y.push(data[i].total)
        }
        this.initTowelevChart(x, y)
      });
    },
    initFirstChart(xAxis,yAxis) {
      var myChart  = echarts.init(this.$refs.first)
      myChart.setOption({
        title: {
          text: '每月充值金额'
        },
        tooltip: {},
        xAxis: {
          type: 'category',
          data: xAxis
        },
        yAxis: {},
        series: [{
          name: '金额',
          type: 'bar',
          data: yAxis
        }]
    });
    },
    initSecordChart(xAxis,yAxis) {
      var myChart  = echarts.init(this.$refs.second)
      myChart.setOption({
        title: {
          text: '每月销售数量'
        },
        tooltip: {},
        xAxis: {
          type: 'category',
          data: xAxis
        },
        yAxis: {},
        series: [{
          name: '销量',
          type: 'line',
          data: yAxis
        }]
    });
    },
    initThirdChart(xAxis,yAxis) {
      var myChart  = echarts.init(this.$refs.third)
      myChart.setOption({
        title: {
          text: '每月题录更新数量'
        },
        tooltip: {},
        xAxis: {
          type: 'category',
          data: xAxis
        },
        yAxis: {},
        series: [{
          name: '销量',
          type: 'line',
          data: yAxis
        }]
    });
    },
    initFourChart(xAxis,yAxis) {
      var myChart  = echarts.init(this.$refs.four)
      myChart.setOption({
        title: {
          text: '每月文本更新数量'
        },
        tooltip: {},
        xAxis: {
          type: 'category',
          data: xAxis
        },
        yAxis: {},
        series: [{
          name: '销量',
          type: 'bar',
          data: yAxis
        }]
    });
    },
    initFiveChart(xAxis,yAxis) {
      var myChart  = echarts.init(this.$refs.five)
      myChart.setOption({
        title: {
          text: '每月国标题录更新数量'
        },
        tooltip: {},
        xAxis: {
          type: 'category',
          data: xAxis
        },
        yAxis: {},
        series: [{
          name: '数量',
          type: 'line',
          data: yAxis
        }]
      });
    },    
    initSixChart(xAxis,yAxis) {
      var myChart  = echarts.init(this.$refs.six)
      myChart.setOption({
        title: {
          text: '每月行标题录更新数量'
        },
        tooltip: {},
        xAxis: {
          type: 'category',
          data: xAxis
        },
        yAxis: {},
        series: [{
          name: '数量',
          type: 'line',
          data: yAxis
        }]
      });
    },
    initSevenChart(xAxis,yAxis) {
      var myChart  = echarts.init(this.$refs.twoteenth)
      myChart.setOption({
        title: {
          text: '每月访问量'
        },
        tooltip: {},
        xAxis: {
          type: 'category',
          data: xAxis
        },
        yAxis: {},
        series: [{
          name: '每月访问量',
          type: 'line',
          data: yAxis
        }]
      });
    },
    initEightChart(xAxis,yAxis) {
      var myChart  = echarts.init(this.$refs.nineth)
      myChart.setOption({
        title: {
          text: '每月下载量'
        },
        tooltip: {},
        xAxis: {
          type: 'category',
          data: xAxis
        },
        yAxis: {},
        series: [{
          name: '每月下载量',
          type: 'line',
          data: yAxis
        }]
      });
    },
    initthirthenChart(xAxis,yAxis) {
      var myChart  = echarts.init(this.$refs.seven)
      myChart.setOption({
        title: {
          text: '每月地标更新数量'
        },
        tooltip: {},
        xAxis: {
          type: 'category',
          data: xAxis
        },
        yAxis: {},
        series: [{
          name: '数量',
          type: 'line',
          data: yAxis
        }]
      });
    },   
    initFourteenChart(xAxis,yAxis) {
      var myChart  = echarts.init(this.$refs.eight)
      myChart.setOption({
        title: {
          text: '每月团标题录更新数量'
        },
        tooltip: {},
        xAxis: {
          type: 'category',
          data: xAxis
        },
        yAxis: {},
        series: [{
          name: '数量',
          type: 'line',
          data: yAxis
        }]
      });
    },   
    initNineChart(xAxis,yAxis) {
      var myChart  = echarts.init(this.$refs.fiveth)
      myChart.setOption({
        title: {
          text: '每月国标题录新增数量'
        },
        tooltip: {},
        xAxis: {
          type: 'category',
          data: xAxis
        },
        yAxis: {},
        series: [{
          name: '数量',
          type: 'line',
          data: yAxis
        }]
      });
    },    
    initTenChart(xAxis,yAxis) {
      var myChart  = echarts.init(this.$refs.sixfh)
      myChart.setOption({
        title: {
          text: '每月地标题录新增数量'
        },
        tooltip: {},
        xAxis: {
          type: 'category',
          data: xAxis
        },
        yAxis: {},
        series: [{
          name: '数量',
          type: 'line',
          data: yAxis
        }]
      });
    },
     initElevenChart(xAxis,yAxis) {
      var myChart  = echarts.init(this.$refs.seventh)
      myChart.setOption({
        title: {
          text: '每月行标题录新增数量'
        },
        tooltip: {},
        xAxis: {
          type: 'category',
          data: xAxis
        },
        yAxis: {},
        series: [{
          name: '数量',
          type: 'line',
          data: yAxis
        }]
      });
    },    
    initTowelevChart(xAxis,yAxis) {
      var myChart  = echarts.init(this.$refs.eightth)
      myChart.setOption({
        title: {
          text: '每月团标题录新增数量'
        },
        tooltip: {},
        xAxis: {
          type: 'category',
          data: xAxis
        },
        yAxis: {},
        series: [{
          name: '数量',
          type: 'line',
          data: yAxis
        }]
      });
    },
  },
};
</script>
<style scpoed>
  .textitem{
    margin-top:5px;
    font-size:14px;
  }
</style>
